<!-- 我的资料 -->
<style lang="less" scoped>
  .r-txt {
    text-align: right;
    width:65%;
  }
  .btn-large {
    border-radius: 0;
  }
  .vux-actionsheet{
    line-height: 30px;
  }

</style>


<template>
  <div class="contain">
    <ul class="text-list">
      <li class="displayflex">
        <span class="l-txt flex1">姓名</span>
        {{basicInfo.realname}}
      </li>
      <li class="displayflex">
        <span class="l-txt flex1">部门</span>
       {{basicInfo.deptname}}
      </li>
      <!-- <li class="displayflex">
        <span class="l-txt flex1">系统用户名</span>
        {{basicInfo.logonuser}}
      </li> -->
      <li class="displayflex">
        <span class="l-txt flex1">电话</span>
       {{basicInfo.mobiletel}}
      </li>
      <li class="displayflex">
        <span class="l-txt flex1">邮箱</span>
       {{basicInfo.eMail}}
      </li>
       <!-- <li class="displayflex">
        <span class="l-txt flex1">接收短信通知</span>
       {{basicInfo.isreceivesms}}
      </li>
        <li class="displayflex">
        <span class="l-txt flex1">接收邮件</span>
       {{basicInfo.isreceiveemail}}
      </li> -->
    </ul>
  </div>
</template>

<script>
import appHeader from '@/components/core/header/app_header.vue';
export default {
  components:{
    appHeader
  },
  data() {
    return {
      basicInfo:[],
    }
  },
  created(){
    document.title = '我的资料';
    this.getData();
  },
  computed:{
    userinfo(){
      return localStorage.getItem('userinfo') === null?null:JSON.parse(localStorage.getItem('userinfo'));
    }
  },
  methods: {
    getData() {
      if(localStorage.userinfo){
        var userinfo = JSON.parse(localStorage.userinfo); 
        console.log(userinfo);
        this.basicInfo = userinfo.curUser;
      }
    },
    SaveData(){
      let query = {
        StaffID: this.userinfo.StaffID,
        Name: this.name,
        MobileTel1: this.numbers,
        BelongName: this.DeptName,
        Sex: this.Sex,
        TenantGuid: this.userinfo.TenantGuid,
        CorpGuid: this.userinfo.CorpGuid,
        UpdateUserId: this.userinfo.StaffID,
        UpdateUserName: this.name,
      };
      this.Ajax.post('UpdateMfstaff',query).then((resp) => {
        if (resp.IsSuccess) {
          this.MessageBox.alert('修改成功！').then(action => {
            localStorage.removeItem('userinfo');
            localStorage.setItem('userinfo', JSON.stringify(resp.Data));
            this.$router.push({
              path:'/user'
            });
          });
        } else {
          this.Toast({
            message: resp.ErrorMessage || '操作失败，请稍后重试'
          });
        }
      });
    }
  }
}
</script>
